﻿using MyProject.Core;
using System.ComponentModel.DataAnnotations;
using System.Runtime.CompilerServices;

namespace MyProject.Entities.Address
{
    public class Address : NotifyPropertyChanged
    {
        public int? id { get; set; }

        [Required(ErrorMessage = "Поле обяз."), MyTitle("Индекс")]
        public int? index { get; set; } = null;

        [Required(ErrorMessage = "Поле является обязательным."), MyTitle("Город")]
        public int? city_id { get; set; } = null;

        [Required(ErrorMessage = "Поле является обязательным"), MyTitle("Улица")]
        public int? street_id { get; set; } = null;

        [Required(ErrorMessage = "Поле обяз."), Length(1, 6), MyTitle("Дом")]
        public string? house { get; set; } = null;

        [MyTitle("Квартира")]
        public int? apartment { get; set; } = null;

        public void NotifyPropChanged([CallerMemberName] string propertyName = "")
        {
            base.NotifyPropChanged(propertyName);
        }
    }
}
